package com.lkj;


import java.util.Arrays;
import java.util.List;

public class Main {

    public static void main(String[] args) {

        String str = "1080009";

        byte[] bytes = HexUtil.strToByteArray(str);
        System.out.println("1.bytes:"+ Arrays.toString(bytes));

        String byteArrayToStr = HexUtil.byteArrayToStr(bytes);
        System.out.println("2.byteArrayToStr:"+byteArrayToStr);

        String hexStr = HexUtil.byteArrayToHexStr(bytes);
        System.out.println("3.hexStr:"+hexStr);

        byte[] strToByteArray = HexUtil.hexStrToByteArray(hexStr);
        System.out.println("4.strToByteArray:"+Arrays.toString(strToByteArray));

        String hexStr1 = HexUtil.strToHexStr(str);
        System.out.println("5.hexStr1:"+hexStr1);

        String hexStr2 = HexUtil.str2HexStr(str);
        System.out.println("5.1.hexStr2:"+hexStr2);

        String str1 = HexUtil.hexStrToStr(hexStr1);
        System.out.println("6.str1:"+str1);

        List<String> integers = Arrays.asList("-30", "-93", "107", "123", "81", "8", "4", "0", "2", "-46", "-44", "69", "59", "-70", "39", "29");
        byte[] bytes1 = new byte[integers.size()] ;
        for (int i = 0; i < integers.size(); i++) {
            String integer = integers.get(i);

            bytes1[i] = Byte.parseByte(integer);
        }

        System.out.println(Arrays.toString(bytes1));

        String s = HexUtil.byteArrayToHexStr(bytes1);
        String s1 = HexUtil.hexStrToStr(s);
        System.out.println(s);
        System.out.println(s1);

    }


}
